<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="app">
        <div>
            <p v-if="isActive">v-if</p>
            <p v-else>v-else</p>
            <p v-show="isActive">v-show</p>
            <button @click="switchAction">点鸡变成哥哥</button>
        </div>
        

        <p v-if="num==0">0</p>
        <p v-else-if="num==1">1</p>
        <p v-show>啥都不是</p>
        <button @click="changgeNum(0)">0</button>
        <button @click="changgeNum(1)">1</button>
        <button @click="changgeNum(3)">啥都不是</button>
    </div>

    <script>
        const app = Vue.createApp({
            data(){
                return {
                    isActive:true,
                    num : 0
                }
            },
            methods:{
                switchAction(){
                    this.isActive = !this.isActive
                    console.log('this.isActive',this.isActive)
                },
                changgeNum(number){
                    this.num = number
                }
            }
        })
        app.mount("#app")
    </script>
</body>
</html>